/*
	Chris Butler
	csc160
	hangman project - int main()
		plays hangman
*/

#include <iostream>
#include <fstream>
#include <string>

#include "hangman.h"

using namespace std;

const string DATAFILE = "data/hangman.dat";
const string HANGMAN_VERSION = "0.02";

int main(int argc, char** argv)
{

	string input;
	string word;	

	ifstream ifile;
	ifile.open(DATAFILE.c_str());

	ifile >> word;
	
	cout << "hangman v" << HANGMAN_VERSION << endl;

	//smart pointer, later, maybe
	hangman* George = new hangman;

	cout << "First word to guess: " << word;
	cout << endl;

	George->drawBoard();

	cout << "Guess a letter: ";
	cin >> input;

	cout << (char)toupper(input[0]) << endl;
	
	while(George->hasTriesLeft())
	{
		George->drawBoard();
	}
	
	delete George;

#ifdef _WIN32
#include <stdlib>
	system("pause");
#endif

	return 0;
}
